package exception;

import java.io.FileOutputStream;
import java.io.IOException;

/**
 * 说明:
 *
 * @author: luohaowei
 * @date:2023/3/9
 * 语法:
 *
 **/
public class AutoCloseableDemo {
    public static void main(String[] args) {
        System.out.println("程序叛变了");
        try (
                FileOutputStream fos=new FileOutputStream("fos.dat");
                ){
            fos.write(1);
        } catch (IOException e) {
            e.printStackTrace();
        }
        System.out.println("程序自杀了");
    }
}
